package minioIniit

import (
	"gin_chat_demo/global"
	"github.com/minio/minio-go/v7"
	"github.com/minio/minio-go/v7/pkg/credentials"
)

func InitMinio(endpoint, accessKeyID, secretAccessKey string) {
	minioClient, err := minio.New(endpoint, &minio.Options{
		Creds:  credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
		Secure: false,
	})
	if err != nil {
		panic("failed to connect jiangLao database")
	}
	global.MinioClient = minioClient
}
